package com.example.zhangxin.comevedio.activity.fragment;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

/**
 * Created by ZhangXin on 2016/9/13.
 */

public abstract class BaseFragment extends Fragment {
    private View mView;
    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        if(mView==null){
            mView = getLayout();
            findView(mView);
            setData();
        }
        return mView;
    }

    protected abstract void setData();

    protected abstract void findView(View view);

    public abstract View getLayout();
}
